<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <!-- <link rel="stylesheet" href="./style.min.css"> -->
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
 <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/layui/2.11.5/css/layui.css" integrity="sha512-SGpnogj026QKlDY3yDe/KwNHdy9Q8pmtxE6h6orMo99teoUPxbLz+leANApR/hEohYxfRglQz0cx0AcWGXQXew==" crossorigin="anonymous" referrerpolicy="no-referrer" /> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.11.5/layui.js" integrity="sha512-oqZ/orzPk6WPklCkJNpTLRpTOpNNvgPM+MkvoGw2s3ZZV2bduXjUdY0k4eFIIksJ6dtv88c/vCq52VxPZGSWlA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="../js/pubilc.js"></script>
<style>
        /* body{
            padding-left: 200px;
           
        } */
        .div{
            width: 500px;
            /* height: 760px; */
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
        }
        /* .xinniji{
             width: 500px;
            height: 300px;
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
        } */
        .table{
            width: 1500px;
            margin-left: 100px;
            margin-top: 50px;
            
        }
        .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
            vertical-align: middle;
        }
        
        .chakan{
            width: 500px;
            height: 300px;
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
        }
        th{
            text-align: center;
            height: 50PX;
          
        }
      .shenhe{
        width: 400px;
        height: 50px;
        background-color: rgb(188, 188, 188);
      }
      .shenqing{
        width: 500px;
         background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
      }
      .chakk{
        width: 500px;
            /* height: 760px; */
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
      }
      .biaoxian{
        width: 500px;
        height: 50px;
        background-color: #f5f5f5;
        padding: 20px;
        border-radius: 10px;
        margin-left: 1000px;
        display: none;
      }
      .xuefen{
        width: 500px;
        height: 50px;
        background-color: #f5f5f5;
        padding: 20px;
        border-radius: 10px;
        margin-left: 1000px;
        display: none;
      }
      .div_pian{
         width: 500px;
            /* height: 760px; */
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 10px;
            margin-left: 1000px;
            display: none;
      }
    </style>
</head>
<body>
    姓名: <input type="text" id="nianji2"> 年级: <input type="text" id="nianji3"> 班级: <input type="text" id="nianji4"><button  class="btn btn-primary" onclick="sou()">搜索</button>
    <button type="button" class="btn btn-primary" onclick="xin()" >新增学生</button><div id="divsen"></div>
    <!-- <div class="shenhe">
        您有待审核的任务 
        <button onclick="Shenhe()">审核</button>
    </div> -->
    <table class="table table-striped text-center" >
    <thead  id="thead">
        <!-- <tr> -->
            <!-- <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>住址</th>
            <th>电话</th>
            <th>学校</th>
            <th>年级</th>
            <th>班级</th>
            <th>专业</th>;
            <th>身份证号</th>
            <th>监护人</th>
            <th>监护人电话</th>
            <th>操作</th> -->
        <!-- </tr> -->
    </thead>
    <tbody id="tbody">
    </tbody>
</table>
<div class="shenqing">
   申请修改 <span class="ap"></span>的信息
   <input type="text" id="shi" class="form-control"  placeholder="请简要说明修改的原因"> 
    <button type="button" class="btn btn-primary btn-lg active"  onclick="add3()">确定</button>
<button type="button" class="btn btn-default btn-lg active" onclick="onadd4()" >取消</button>
</div>
<div class="div">
    <span id="sp">新增</span>
    <div class="form-group">
        <label for="name">学生名称</label>
        <input type="text" class="form-control" id="name" placeholder="请输入学生名称">
    </div>
    <div class="form-group">
        <label for="level">年级</label>
        <!-- <input type="text" class="form-control"  id="level" placeholder="请输入年级"> -->
         <select name="" id="level" class="form-control">
            <!-- <option value="1">大一</option>
            <option value="2">大二</option>
            <option value="3">大三</option>
            <option value="4">大四</option> -->
        </select>
    </div>
     <div class="form-group">
        <label for="level">班级</label>
        <!-- <input type="text" class="form-control"  id="level2" placeholder="请输入班级"> -->
         <select name="" id="level2" class="form-control">
            <!-- <option value="1">一班</option>
            <option value="2">二班</option>
            <option value="3">三班</option>
            <option value="4">四班</option>
            <option value="5">五班</option> -->
        </select>
    </div>
     <div class="form-group">
        <label for="level">籍贯</label>
        <input type="text" class="form-control"  id="level3" placeholder="请输入籍贯">
    </div>
     <div class="form-group">
        <label for="level">电话</label>
        <input type="text" class="form-control"  id="level4" placeholder="请输入电话">
    </div>
     <div class="form-group">
        <label for="level">性别</label>
        <!-- <input type="text" class="form-control"  id="level5" placeholder="请输入性别"> -->
        <select name="" id="level5" class="form-control">
            <option value="男">男</option>
            <option value="女">女</option>
        </select>   
    </div>
     <div class="form-group">
        <label for="level">专业</label>
        <!-- <input type="text" class="form-control"  id="level6" placeholder="请输入专业"> -->
        <select name="" id="level6" class="form-control">
            <!-- <option value="前端">前端</option>
            <option value="java">java</option>
            <option value="php">php</option>
            <option value="c++">c++</option> -->
        </select>   
    </div>
     <div class="form-group">
        <label for="level">年龄</label>
        <input type="text" class="form-control"  id="level7" placeholder="请输入入学时间">
    </div>
    <div class="form-group">
        <label for="level">监护人</label>
        <input type="text" class="form-control"  id="jianhu1" placeholder="请输入家长姓名">
    </div>
    <div class="form-group">
        <label for="level">监护人电话</label>
        <input type="text" class="form-control"  id="jianhudian1" placeholder="请输入家长电话">
    </div>
    <div class="form-group">
        <label for="level">身份证号</label>
        <input type="text" class="form-control"  id="sfz1" placeholder="请输入身份证号">
    </div>
    <div class="form-group">
        <label for="level">头像</label>
        <!-- <input type="text" class="form-control"  id="sr1" placeholder="请输入出生日期"> -->
         <input type="file" id="fileSC">
    </div>
    <!-- <div class="form-group">
        <label for="level">学校</label>
        <select name="" id="zhuang1" class="form-control">
            <option value="正常">正常</option>
            <option value="异常">异常</option>
        </select> -->
    <!-- </div> -->
    <button type="button" class="btn btn-primary btn-lg active"  onclick="add()">确定</button>
<button type="button" class="btn btn-default btn-lg active" onclick="onadd()" >取消</button>
  
</div>
<!-- //////////////////////////////////////////////////////////////////////// -->
 <div class="div_pian">
    <span id="sp">新增</span>
    <div class="form-group">
        <label for="name">学生名称</label>
        <input type="text" class="form-control" id="name_p" placeholder="请输入学生名称">
    </div>
    <div class="form-group">
        <label for="level">年级</label>
        <!-- <input type="text" class="form-control"  id="level" placeholder="请输入年级"> -->
         <select name="" id="level_p" class="form-control">
            <!-- <option value="1">大一</option>
            <option value="2">大二</option>
            <option value="3">大三</option>
            <option value="4">大四</option> -->
        </select>
    </div>
     <div class="form-group">
        <label for="level">班级</label>
        <!-- <input type="text" class="form-control"  id="level2" placeholder="请输入班级"> -->
         <select name="" id="level2_p" class="form-control">
            <!-- <option value="1">一班</option>
            <option value="2">二班</option>
            <option value="3">三班</option>
            <option value="4">四班</option>
            <option value="5">五班</option> -->
        </select>
    </div>
     <div class="form-group">
        <label for="level">籍贯</label>
        <input type="text" class="form-control"  id="level3_p" placeholder="请输入籍贯">
    </div>
     <div class="form-group">
        <label for="level">电话</label>
        <input type="text" class="form-control"  id="level4_p" placeholder="请输入电话">
    </div>
     <div class="form-group">
        <label for="level">性别</label>
        <!-- <input type="text" class="form-control"  id="level5" placeholder="请输入性别"> -->
        <select name="" id="level5_p" class="form-control">
            <option value="男">男</option>
            <option value="女">女</option>
        </select>   
    </div>
     <div class="form-group">
        <label for="level">专业</label>
        <!-- <input type="text" class="form-control"  id="level6" placeholder="请输入专业"> -->
        <select name="" id="level6_p" class="form-control">
            <!-- <option value="前端">前端</option>
            <option value="java">java</option>
            <option value="php">php</option>
            <option value="c++">c++</option> -->
        </select>   
    </div>
     <div class="form-group">
        <label for="level">年龄</label>
        <input type="text" class="form-control"  id="level7_p" placeholder="请输入入学时间">
    </div>
    <div class="form-group">
        <label for="level">监护人</label>
        <input type="text" class="form-control"  id="jianhu1_p" placeholder="请输入家长姓名">
    </div>
    <div class="form-group">
        <label for="level">监护人电话</label>
        <input type="text" class="form-control"  id="jianhudian1_p" placeholder="请输入家长电话">
    </div>
    <div class="form-group">
        <label for="level">身份证号</label>
        <input type="text" class="form-control"  id="sfz1_p" placeholder="请输入身份证号">
    </div>
    <div class="form-group">
        <label for="level">头像</label>
        <!-- <input type="text" class="form-control"  id="sr1" placeholder="请输入出生日期"> -->
         <input type="file" id="fileSC_p">
    </div>
    <!-- <div class="form-group">
        <label for="level">学校</label>
        <select name="" id="zhuang1" class="form-control">
            <option value="正常">正常</option>
            <option value="异常">异常</option>
        </select> -->
    <!-- </div> -->
    <button type="button" class="btn btn-primary btn-lg active"  onclick="add_Pian()">确定</button>
<button type="button" class="btn btn-default btn-lg active" onclick="onadd_Pian()" >取消</button>
  
</div>
<!-- //////////////////////////////////////////////////////////////////////// -->
<!-- <div class="xinniji">
    所属年级：<span class="sp2"></span><br>
     <label for="name">班级名称</label>
        <input type="text" class="form-control" id="name2" placeholder="请输入班级名称">
         <button type="button" class="btn btn-primary btn-lg active"  onclick="add2()">确定</button>
<button type="button" class="btn btn-default btn-lg active" onclick="onadd2()" >取消</button>
</div> -->
<!-- <div class="chakan">
    <div id="ID-tree-demo-showLine"></div>
    <button onclick="qwe()" style="margin-top: 150px;">取消</button>
</div> -->
<div class="chakk">
    学生信息：<span id="spp"></span>
    <button onclick="xin_biao()">新增学生表现</button>

    <table border="1" style="width: 400px;">
    <thead >
        <tr >
            <th>时间</th>
            <th>表现</th>
        </tr>
    </thead>
    <tbody id="tbody2">
    </tbody>
</table>
 <button onclick="xin_fen()">新增学分</button>

    <table border="1" style="width: 400px;">
    <thead >
        <tr >
            <th>时间</th>
            <th>学分</th>
        </tr>
    </thead>
    <tbody id="tbody3">
    </tbody>
</table>
<button onclick="chakk_onadd()">关闭</button>
</div>
<div class="biaoxian">
    表现：<input type="text" id="biao_inp">
    <button onclick="biao_add()">确定</button>
    <button onclick="biao_onadd()">取消</button>
</div>
<div class="xuefen">
    学分：<input type="text" id="fen_inp">
    <button onclick="fen_add()">确定</button>
    <button onclick="fen_onadd()">取消</button>
</div>
<script>
var tbody = document.getElementById("tbody");
var div = document.getElementsByClassName('div')[0]

var data = [
    // {ming:'班主任',nian:'四级',ban:'一班',jiguan:'北极',dian:'123321231312231',xing:'男',zhuan:'前端',ruxue:'2025-1-3',jianhu:'www',jianhudian:'123456543212',sfz:'110234200002049875',sr:'2000-02-04',zhuang:'正常'},
    //  {ming:'年级主任',nian:'三级',ban:'四班',jiguan:'南极',dian:'123423423231',xing:'男',zhuan:'ui',ruxue:'2025-1-3',jianhu:'www',jianhudian:'123456543212',sfz:'110234200002049875',sr:'2000-02-04',zhuang:'正常'},
    //   {ming:'教导主任',nian:'三级',ban:'三班',jiguan:'东极',dian:'12243241312231',xing:'男',zhuan:'java',ruxue:'2025-1-3',jianhu:'www',jianhudian:'123456543212',sfz:'110234200002049875',sr:'2000-02-04',zhuang:'正常'},
    //    {ming:'副校长',nian:'一级',ban:'二班',jiguan:'西极',dian:'534534553312231',xing:'男',zhuan:'php',ruxue:'2025-1-3',jianhu:'www',jianhudian:'123456543212',sfz:'110234200002049875',sr:'2000-02-04',zhuang:'正常'},
    //     {ming:'校长',nian:'特级',ban:'三班',jiguan:'月球',dian:'1345345534512231',xing:'男',zhuan:'c++',ruxue:'2025-1-3',jianhu:'www',jianhudian:'123456543212',sfz:'110234200002049875',sr:'2000-02-04',zhuang:'正常'},
        
]
var kly;
pan()
function pan(){
if('1'!==1&&'2!'!==2){
                            console.log('777')
                        }
}
function xin(){
   var zhuan;
xhr({
                methods: 'get',
                url: `/specialty/get?school_id=${Number(sessionStorage.getItem('id'))}`,
                success: function (res) {
                    console.log(res)
                    for(var i=0;i<res.length;i++){
                   level6.innerHTML+=`<option value="${res[i].specialty_id}">${res[i].specialty_name}</option>`
                    }
                }
                })
                 xhr({
    methods:'get',
    url:`/gradeAndClass/getGradeAndClass?grade_school_id=${Number(sessionStorage.getItem('id'))}`,
    //  data:JSON.stringify({
    //  }),
    success:function(res){
    console.log(res)

   var da = res
   console.log(da)
    for(var i=0;i<da.length;i++){
       level.innerHTML+=`<option value="${da[i].Id}">${da[i].grade_name}</option>`
       for(var j=0;j<da[i].gradeClasses.length;j++){
           level2.innerHTML+=`<option value="${da[i].gradeClasses[j].class_id}">${da[i].gradeClasses[j].class_name}</option>`
       }
    }
    }
})
 
    //   name.value = ''
    // level.value = ''
    // level2.value = ''
    // level3.value = ''
    // level4.value = ''
    // level5.value = ''
    // level6.value = ''
    // level7.value = ''
    // jianhu1.value=''
    // jianhudian1.value=''
    // sfz1.value=''
    // sr1.value=''
   // zhuang1.value=''
    sp.innerHTML = '新增'
div.style.display = 'block'
kly=-1
}
function onadd(){
    div.style.display = 'none'
    //  name.value = ''
    // level.value = ''
    //  level2.value = ''
    // level3.value = ''
    // level4.value = ''
    // level5.value = ''
    // level6.value = ''
    // level7.value = ''
    //  jianhu1.value=''
    // jianhudian1.value=''
    // sfz1.value=''
    // sr1.value=''
   // zhuang1.value=''
}
var array=[]
var arr_id=[]
a()
function a(){
    console.log(array)
   

    // tbody.innerHTML=''
    // for(var i=0;i<data.length;i++){
    //     tbody.innerHTML+=`<tr>
    //          <td>${data[i].ming}</td>
    //          <td>${data[i].nian}</td>
    //           <td>${data[i].ban}</td>
    //          <td>${data[i].jiguan}</td>
    //     <td>${data[i].dian}</td>
    //     <td>${data[i].xing}</td>
    //     <td>${data[i].zhuan}</td>
    //     <td>${data[i].ruxue}</td>
    //      <td>${data[i].jianhu}</td>
    //     <td>${data[i].jianhudian}</td>
    //     <td>${data[i].sfz}</td>
    //     // <td>${data[i].sr}</td>
    //     <td>${data[i].zhuang}</td>
    //     <td>
    //         <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改</span>
    //          <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
    //            <span class="btn btn-primary m-r-5" onclick="cha(${i})">审核</span>
          
    //     </td>
    // </tr>`
    // }
    var token = sessionStorage.getItem('token')
                xhr({
                methods:'get',
                url:'/user/info',
                header:{
                    token:token
                },
                success:function(res){
                    console.log(res.identity)
                    if(res.user_id==7){
                         var token = sessionStorage.getItem('token')
console.log(token)
      xhr({  
                            methods:'get',
                            url:'/student/getStudentAudit',
                             header:{
                        token:token
                           },
                            success:function(res){
                                console.log(res)
                                console.log(res.audit[0].Id)
                                arr_id.push(res.audit[0].Id)
                                if(res.audit.length==0){
                              divsen.innerHTML=''
                                }else{
                                     divsen.innerHTML='<div class="shenhe">您有待审核的任务 <button onclick="Shenhe()">审核</button></div>'
                                }
                            }
                        })
                        // xhr({
                        //     methods:'get',
                        //     url:'/student/getStudentAudit',
                        //     success:function(res){
                        //         console.log(res)
                        //         divsen.innerHTML='<div class="shenhe">您有待审核的任务 <button onclick="Shenhe()">审核</button></div>'
                        //     }
                        // })
                        
                       console.log('9999999')
                        xhr({
    methods: 'get',
                    url: `/rankSys/getFn?school_id=${Number(sessionStorage.getItem('id'))}`,
                    success: function (res) {
                        console.log(res)
                        console.log(res[0].page_id)
                     
                        
                        if(res[0].page_id==1&&res[1].page_id==2){
                             thead.innerHTML=''
                            thead.innerHTML+=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>年级</th>
                            <th>班级</th>
                            <th>专业</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('1')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].specialty_id}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian_you(${i})">修改</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[0].page_id!==1&&res[1].page_id!==2){
                             thead.innerHTML=''
                             thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                             xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('12')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian_you(${i})">修改</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[0].page_id==1){
                             thead.innerHTML=''
                              thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>专业</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('123')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].specialty_id}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian_you(${i})">修改</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[1].page_id==2){
                             thead.innerHTML=''
                              thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>年级</th>
                            <th>班级</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('1234')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].student_class}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian_you(${i})">修改</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        
                      }
                    }
})
//申请
                    }else{
                         var token = sessionStorage.getItem('token')
                        xhr({  
                            methods:'get',
                            url:'/student/getStudentAudit',
                             header:{
                        token:token
                           },
                            success:function(res){
                                console.log(res)
                             console.log(res.audit2.length)
                             if(res.audit2.length==0){
                               // arr_id.push(res.audit[0].Id)
                               divsen.innerHTML=''
                               }else{
                                
                                  divsen.innerHTML='<div class="shenhe">您的审核已通过请前往 <button onclick="XShenhe()">修改</button></div>'
                            }
                            }
                            
                        })
                        xhr({
    methods: 'get',
                    url: `/rankSys/getFn?school_id=${Number(sessionStorage.getItem('id'))}`,
                    success: function (res) {
                        console.log(res)
                        console.log(res[0].page_id)
                     
                        
                        if(res[0].page_id==1&&res[1].page_id==2){
                             thead.innerHTML=''
                            thead.innerHTML+=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>年级</th>
                            <th>班级</th>
                            <th>专业</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('1')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].specialty_id}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改(申请)</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[0].page_id!==1&&res[1].page_id!==2){
                             thead.innerHTML=''
                             thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                             xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('12')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改(申请)</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[0].page_id==1){
                             thead.innerHTML=''
                              thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>专业</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('123')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].specialty_id}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改(申请)</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        }else if(res[1].page_id==2){
                             thead.innerHTML=''
                              thead.innerHTML=`<tr>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>住址</th>
                            <th>电话</th>
                            <th>学校</th>
                            <th>年级</th>
                            <th>班级</th>
                            <th>身份证号</th>
                            <th>监护人</th>
                            <th>监护人电话</th>
                            <th>操作</th>
                            </tr>`
                            xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('1234')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            tbody.innerHTML+=`<tr>
            <td>${res[i].student_name}</td>
            <td>${res[i].student_sex}</td>
            <td>${res[i].student_age}</td>
            <td>${res[i].student_address}</td>
            <td>${res[i].student_phone}</td>
            <td>${res[i].student_school}</td>
            <td>${res[i].student_grade}</td>
            <td>${res[i].student_class}</td>
            <td>${res[i].student_pic_idcard}</td>
            <td>${res[i].guardian_phone}</td>
            <td>${res[i].guardian_name}</td>
            <td>
                <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改(申请)</span>
                <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
                <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
            </td>
        </tr>`
        }
    }
    })
                        
                      }
                    }
})
                    }
                    
                }
            })
   
   
}
function Shenhe(){
 
         
                     xhr({
        methods:'post',
        url:'/student/audit',
        data:JSON.stringify({
            id:JSON.stringify(arr_id[0]),
        }),
        success:function(res){
            console.log(res)
        }
    })
    }




var div_pian = document.getElementsByClassName('div_pian')[0]
    
    function XShenhe(){
       
    sp.innerHTML = '编辑1'
        div_pian.style.display='block'
        xhr({
                methods: 'get',
                url: `/specialty/get?school_id=${Number(sessionStorage.getItem('id'))}`,
                success: function (res) {
                    console.log(res)
                    for(var i=0;i<res.length;i++){
                   level6_p.innerHTML+=`<option value="${res[i].specialty_id}">${res[i].specialty_name}</option>`
                    }
                }
                })
                 xhr({
    methods:'get',
    url:`/gradeAndClass/getGradeAndClass?grade_school_id=${Number(sessionStorage.getItem('id'))}`,
    //  data:JSON.stringify({
    //  }),
    success:function(res){
    console.log(res)

   var da = res
   console.log(da)
    for(var i=0;i<da.length;i++){
       level_p.innerHTML+=`<option value="${da[i].Id}">${da[i].grade_name}</option>`
       for(var j=0;j<da[i].gradeClasses.length;j++){
           level2_p.innerHTML+=`<option value="${da[i].gradeClasses[j].class_id}">${da[i].gradeClasses[j].class_name}</option>`
       }
    }
    }
})
         xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log(res)
for(var i=0;i<res.length;i++){
    name_p.value = res[i].student_name
    level_p.value = res[i].student_grade
    level2_p.value = res[i].student_class
    level3_p.value = res[i].student_address
    level4_p.value = res[i].student_phone
    level5_p.value = res[i].student_sex
    level6_p.value = res[i].specialty_id
    level7_p.value = res[i].student_age
    jianhu1_p.value = res[i].guardian_phone
    jianhudian1_p.value = res[i].guardian_name
    sfz1_p.value = res[i].student_pic_idcard
    }
}
    })

       
  
//    console.log(arr_id[0])
    
         
//                      xhr({
//         methods:'post',
//         url:'/student/audit',
//         data:JSON.stringify({
//             id:JSON.stringify(arr_id[0]),
//         }),
//         success:function(res){
//             console.log(res)
//         }
//     })

    }
   var formUrl_p ;
        //图片
        fileSC_p.addEventListener('change', function () {
	var file = fileSC_p.files[0]
	var form = new FormData()
	form.append('file', file)
	xhr({
		url: '/upload/upload',
		methods: 'post',
		header: {},
		data: form,
		success: function (res) {
			console.log(res)
			formUrl = res
		}
	})
})
      function add_Pian(){

        xhr({
         methods:'post',
    url:'/student/getList',
    data:JSON.stringify({
        page:1,
        limit:5,
        student_school:Number(sessionStorage.getItem('id')),
    }),
    success:function(res){
        console.log('1')
        console.log(res)
        data.push(...res)
        tbody.innerHTML=''
        for(var i=0;i<res.length;i++){
            console.log(res[i].Id)
              xhr({
            methods:'post',
            url:'/student/editStudent',
            data:JSON.stringify({
               student_name:name_p.value,
        student_sex:level5_p.value,
        student_age:level7_p.value,
        student_address:level3_p.value,
        student_phone:level4_p.value,
        student_school:Number(sessionStorage.getItem('id')),
        student_grade:level_p.value,
        student_class:level2_p.value,
        specialty_id:level6_p.value,
        student_pic_head:formUrl_p,
        //身份证
        student_pic_idcard:sfz1_p.value,
        //监护人
        guardian_phone:jianhu1_p.value,
        //监护人电话
        guardian_name:jianhudian1_p.value,
        id:res[i].Id,
            }),
            success:function(res){
                console.log(res);
                thead.innerHTML=''
                a()
            }
        })
        }
    }
    })
        onadd_Pian()
      }          
        function  onadd_Pian(){
            div_pian.style.display='none'
        }
   

function add(){
  var name = document.getElementById('name');
 var level = document.getElementById('level');
 var level2 = document.getElementById('level2');
 var level3 = document.getElementById('level3');
 var level4 = document.getElementById('level4');
 var level5 = document.getElementById('level5');
 var level6 = document.getElementById('level6');
 var level7 = document.getElementById('level7');
    var tr = document.createElement('tr')
    if(kly==-1){
        // data.push({ming:name.value,nian:level.value,ban:level2.value,jiguan:level3.value,dian:level4.value,xing:level5.value,zhuan:level6.value,ruxue:level7.value,jianhu:jianhu1.value,jianhudian:jianhudian1.value,sfz:sfz1.value,sr:sr1.value,zhuang:zhuang1.value})
          xhr({
    methods:'post',
    url:'/student/addStudent',
    data:JSON.stringify({
        student_name:name.value,
        student_sex:level5.value,
        student_age:level7.value,
        student_address:level3.value,
        student_phone:level4.value,
        student_school:Number(sessionStorage.getItem('id')),
        student_grade:level.value,
        student_class:level2.value,
        specialty_id:level6.value,
        student_pic_head:formUrl,
        //身份证
        student_pic_idcard:sfz1.value,
        //监护人
        guardian_phone:jianhu1.value,
        //监护人电话
        guardian_name:jianhudian1.value,
    }),
    success:function(res){
        console.log(res);
    }

})
console.log(level4.value)
    }else if(kly>=0){
        xhr({
            methods:'post',
            url:'/student/editStudent',
            data:JSON.stringify({
               student_name:name.value,
        student_sex:level5.value,
        student_age:level7.value,
        student_address:level3.value,
        student_phone:level4.value,
        student_school:Number(sessionStorage.getItem('id')),
        student_grade:level.value,
        student_class:level2.value,
        specialty_id:level6.value,
        student_pic_head:formUrl,
        //身份证
        student_pic_idcard:sfz1.value,
        //监护人
        guardian_phone:jianhu1.value,
        //监护人电话
        guardian_name:jianhudian1.value,
        id:data[kly].Id,
            }),
            success:function(res){
                console.log(res);
                thead.innerHTML=''
                a()
            }
        })
        // data[kly].ming= name.value
        // data[kly].nian = level.value
        // data[kly].ban=level2.value
        // data[kly].jiguan=level3.value
        // data[kly].dian=level4.value
        // data[kly].xing=level5.value
        // data[kly].zhuan=level6.value
        // data[kly].ruxue=level7.value
        // data[kly].jianhu=jianhu1.value
        // data[kly].jianhudian=jianhudian1.value
        // data[kly].sfz=sfz1.value
        // data[kly].sr=sr1.value
        // data[kly].zhuang=zhuang1.value
       
    }
    
    onadd()
    // name.value = ''
    // level.value = ''
    //  level2.value = ''
    // level3.value = ''
    // level4.value = ''
    // level5.value = ''
    // level6.value = ''
    // level7.value = ''
    //  jianhu1.value=''
    // jianhudian1.value=''
    // sfz1.value=''
    // // sr1.value=''
    // zhuang1.value=''
}
var ap = document.getElementsByClassName('ap')[0]
var shenqing = document.getElementsByClassName('shenqing')[0]
function bian_you(f){
      var zhuan;
xhr({
                methods: 'get',
                url: `/specialty/get?school_id=${Number(sessionStorage.getItem('id'))}`,
                success: function (res) {
                    console.log(res)
                    for(var i=0;i<res.length;i++){
                   level6.innerHTML+=`<option value="${res[i].specialty_id}">${res[i].specialty_name}</option>`
                    }
                }
                })
                 xhr({
    methods:'get',
    url:`/gradeAndClass/getGradeAndClass?grade_school_id=${Number(sessionStorage.getItem('id'))}`,
    //  data:JSON.stringify({
    //  }),
    success:function(res){
    console.log(res)

   var da = res
   console.log(da)
    for(var i=0;i<da.length;i++){
       level.innerHTML+=`<option value="${da[i].Id}">${da[i].grade_name}</option>`
       for(var j=0;j<da[i].gradeClasses.length;j++){
           level2.innerHTML+=`<option value="${da[i].gradeClasses[j].class_id}">${da[i].gradeClasses[j].class_name}</option>`
       }
    }
    }
})
    var name = document.getElementById('name');
 var level = document.getElementById('level');
    sp.innerHTML = '编辑'
    div.style.display = 'block'
   
    kly=f
    name.value = data[f].student_name
    level.value = data[f].student_grade
    level2.value = data[f].student_class
    level3.value = data[f].student_address
    level4.value = data[f].student_phone
    level5.value = data[f].student_sex
    level6.value = data[f].specialty_id
    level7.value = data[f].student_age
    jianhu1.value = data[f].guardian_phone
    jianhudian1.value = data[f].guardian_name
    sfz1.value = data[f].student_pic_idcard
    // name.value = data[f].ming
    // level.value = data[f].nian
    //     level2.value=data[f].ban 
    //        level3.value=data[f].jiguan 
    //        level4.value= data[f].dian
    //        level5.value= data[f].xing
    //        level6.value= data[f].zhuan
    //       level7.value= data[f].ruxue 
    //       jianhu1.value=data[f].jianhu
    //       jianhudian1.value=data[f].jianhudian
    //       sfz1.value=data[f].sfz
        //   sr1.value=data[f].sr
        //   zhuang1.value=data[f].zhuang

}
function bian(f){
console.log(data[f].Id)
  shenqing.style.display='block'
     ap.innerHTML=`${data[f].student_name}`
     xhr({
        methods:'post',
        url:`/student/studentAuditSubmit`,
        data:JSON.stringify({
            student_id:data[f].Id,
            proposer_id:res.user_id,
            audit_remark:shi.value,
            school_id:Number(sessionStorage.getItem('id')),
        }),
        success:function(res){
            console.log(res)
        }
    })

}
function add3(){
    var token = sessionStorage.getItem('token')
xhr({
                methods:'get',
                url:'/user/info',
                header:{
                    token:token
                },
                success:function(res){
                    console.log(res)
                   console.log(res.user_id)
                for(var i=0;i<data.length;i++){
                console.log(data[i].Id)
                console.log('123')
                   xhr({
                    methods:'post',
                    url:'/student/studentAuditSubmit',
                    data:JSON.stringify({
                        student_id:data[i].Id,
                        proposer_id:res.user_id,
                        audit_remark:shi.value,
                        school_id:Number(sessionStorage.getItem('id')),
                    }),
                    success:function(res){
                        console.log(res)
                    }
                })
                
            }
                }
                
            })
           
           
          
}
function onadd4(){
    shenqing.style.display='none'
}
function shan(i){
     var userResponse = confirm("是否确认删除");
if (userResponse) {
     data.splice(i, 1)
       tbody.innerHTML=''
       for(var i=0;i<data.length;i++){
        tbody.innerHTML+=`<tr>
             <td>${data[i].ming}</td>
             <td>${data[i].nian}</td>
              <td>${data[i].ban}</td>
             <td>${data[i].jiguan}</td>
        <td>${data[i].dian}</td>
        <td>${data[i].xing}</td>
        <td>${data[i].zhuan}</td>
        <td>${data[i].ruxue}</td>
        <td>${data[i].jianhu}</td>
        <td>${data[i].jianhudian}</td>
        <td>${data[i].sfz}</td>
        <td>${data[i].sr}</td>
        <td>${data[i].zhuang}</td>
        <td>
            <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改(申请)</span>
             <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
               <span class="btn btn-primary m-r-5" onclick="cha(${i})">查看</span>
          
        </td>
    </tr>`
    }}else{

    }
}
// var sp2 = document.getElementsByClassName('sp2')[0]
//  var chakan  = document.getElementsByClassName('chakan')[0]
// function cha(i){
//    chakan.style.display ='block'
//       var asd = data[i].ban
//  layui.use(function(){
//   var tree = layui.tree;
//   // 模拟数据

// var datae = [{title:`${asd}`,id:1,children:[{title:'南昌',id:1000}]}];
//   // 渲染  
// console.log('daf')
//   tree.render({
//     elem: '#ID-tree-demo-showLine',
//     data: datae,
//     showLine: false  // 是否开启连接线
    
//   });
//   return datae
// });
// console.log(datae)
// }

//    function qwe(){
//     chakan.style.display ='none'
//    }
 function fuzzyQuery(list, keyWord) {
            var arr = [];
            for (var i = 0; i < list.length; i++) {
                if (list[i].ming.indexOf(keyWord) >= 0) {
                    arr.push(list[i]);
                }
            }
            return arr;
        }
         function fuzzyQuery2(list, keyWord) {
            var arr2 = [];
            for (var i = 0; i < list.length; i++) {
                if (list[i].nian.indexOf(keyWord) >= 0) {
                    arr2.push(list[i]);
                }
            }
            return arr2;
        }
         function fuzzyQuery3(list, keyWord) {
            var arr3 = [];
            for (var i = 0; i < list.length; i++) {
                if (list[i].ban.indexOf(keyWord) >= 0) {
                    arr3.push(list[i]);
                }
            }
            return arr3;
        }
        function sou(){
            var arr = fuzzyQuery(data, nianji2.value)
            tbody.innerHTML=''
            for(var i=0;i<arr.length;i++){
                // tbody.innerHTML=''
                 tbody.innerHTML +=`<tr>
             <td>${arr[i].ming}</td>
             <td>${arr[i].nian}</td>
              <td>${arr[i].ban}</td>
             <td>${arr[i].jiguan}</td>
        <td>${arr[i].dian}</td>
        <td>${arr[i].xing}</td>
        <td>${arr[i].zhuan}</td>
        <td>${arr[i].ruxue}</td>
        <td>${arr[i].jianhu}</td>
        <td>${arr[i].jianhudian}</td>
        <td>${arr[i].sfz}</td>
        <td>${arr[i].sr}</td>
        <td>${arr[i].zhuang}</td>
        <td>
            <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改</span>
             <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
               <span class="btn btn-primary m-r-5" onclick="cha(${i})">审核</span>
          
        </td>
    </tr>`
            }
            console.log(arr)
           var arr2 = fuzzyQuery2(arr, nianji3.value)
           tbody.innerHTML=''
            for(var i=0;i<arr2.length;i++){
                // tbody.innerHTML=''
                 tbody.innerHTML +=`<tr>
             <td>${arr2[i].ming}</td>
             <td>${arr2[i].nian}</td>
              <td>${arr2[i].ban}</td>
             <td>${arr2[i].jiguan}</td>
        <td>${arr2[i].dian}</td>
        <td>${arr2[i].xing}</td>
        <td>${arr2[i].zhuan}</td>
        <td>${arr2[i].ruxue}</td>
        <td>${arr2[i].jianhu}</td>
        <td>${arr2[i].jianhudian}</td>
        <td>${arr2[i].sfz}</td>
        <td>${arr2[i].sr}</td>
        <td>${arr2[i].zhuang}</td>
        <td>
            <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改</span>
             <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
               <span class="btn btn-primary m-r-5" onclick="cha(${i})">审核</span>
          
        </td>
    </tr>`
            }
            console.log(arr2)
             var arr3 = fuzzyQuery3(arr2, nianji4.value)
           tbody.innerHTML=''
            for(var i=0;i<arr3.length;i++){
                // tbody.innerHTML=''
                 tbody.innerHTML +=`<tr>
             <td>${arr3[i].ming}</td>
             <td>${arr3[i].nian}</td>
              <td>${arr3[i].ban}</td>
             <td>${arr3[i].jiguan}</td>
        <td>${arr3[i].dian}</td>
        <td>${arr3[i].xing}</td>
        <td>${arr3[i].zhuan}</td>
        <td>${arr3[i].ruxue}</td>
        <td>${arr3[i].jianhu}</td>
        <td>${arr3[i].jianhudian}</td>
        <td>${arr3[i].sfz}</td>
        <td>${arr3[i].sr}</td>
        <td>${arr3[i].zhuang}</td>
        <td>
            <span class="btn btn-primary m-r-5" onclick="bian(${i})">修改</span>
             <span class="btn btn-primary m-r-5" onclick="shan(${i})">删除</span>
               <span class="btn btn-primary m-r-5" onclick="cha(${i})">审核</span>
          
        </td>
    </tr>`
            }
            console.log(arr3)
        }
        var formUrl ;
        //图片
        fileSC.addEventListener('change', function () {
	var file = fileSC.files[0]
	var form = new FormData()
	form.append('file', file)
	xhr({
		url: '/upload/upload',
		methods: 'post',
		header: {},
		data: form,
		success: function (res) {
			console.log(res)
			formUrl = res
		}
	})
})
var chakk = document.getElementsByClassName('chakk')[0]
var tbody2 = document.getElementById('tbody2')
function cha(i){
    chakk.style.display='block'
spp.innerHTML=`${data[i].student_name}-${data[i].student_sex}-${data[i].student_age}-${data[i].student_address}-${data[i].student_phone}-${data[i].student_school}-${data[i].student_grade}-${data[i].student_class}-${data[i].specialty_id}-${data[i].student_pic_idcard}-${data[i].guardian_phone}-${data[i].guardian_name}`
for(var i=0;i<data.length;i++){
    xhr({
    url:'/student/getStudentDetail',
    methods:'post',
    data:JSON.stringify({
        id:data[i].Id
    }),
    success:function(res){
        console.log(res)
       
        console.log('740')
        for(var i=0;i<res.studentManifestation.length;i++){
            console.log('743')
           
                console.log('744')
                 tbody2.innerHTML +=`<tr>
            
            <td>${res.studentManifestation[i].occurrence_time}</td>
            <td>${res.studentManifestation[i].occurrence_content}</td>
            </tr>`
            }
            for(var j=0;j<res.studentScores.length;j++){
                
                tbody3.innerHTML +=`<tr>
            
            <td>${res.studentScores[j].score_time}</td>
            <td>${res.studentScores[j].student_score}</td>
            </tr>`
            }
           
        
    }
})

}

}
function chakk_onadd(){
    chakk.style.display='none'
   
}
var biaoxian = document.getElementsByClassName('biaoxian')[0]
function xin_biao(){
    biaoxian.style.display='block'
}
    

function biao_add(){
     for(var i=0;i<data.length;i++){
       
        console.log(data[i].Id)
 xhr({
    url:'/student/addStudentManifestation',
    methods:'post',
    data:JSON.stringify({
        student_id:data[i].Id,
        occurrence_content:document.getElementById('biao_inp').value
    }),
    success:function(res){
        console.log(res)
    }
   })
    
    }
  
}
function xin_fen(){
    var xuefen = document.getElementsByClassName('xuefen')[0]
    xuefen.style.display='block'

}
function fen_add(){
    for(var i=0;i<data.length;i++){
       
        console.log(data[i].Id)
 xhr({
    url:'/student/addStudentCredit',
    methods:'post',
    data:JSON.stringify({
        student_id:data[i].Id,
        student_score:document.getElementById('fen_inp').value
    }),
    success:function(res){
        console.log(res)
    }
   })
    
    }
}
function fen_onadd(){
    var xuefen = document.getElementsByClassName('xuefen')[0]
    xuefen.style.display='none'
}
// function bian_you(i){
    
// }
</script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
</body>
</html>